package com.talkingdata.hadoop.guard.mapper;

import com.talkingdata.hadoop.guard.bean.Student;
import org.apache.ibatis.annotations.*;

@Mapper
public interface StudentMapper {
    @Insert("insert into student (name,age) values (#{name},#{stuage})")
    int insertStudent(Student student);

    @Results(value = {
            @Result(property = "stuage", column = "age")
            //@Result(property = "stuage", column = "age", jdbcType = JdbcType.VARCHAR)
    })
    @Select("select * from student where name = #{name}")
    Student selectStuByName(String name );

    @Select("select max(age) from student where name = #{name}")
    int selectMaxAgeByName(String name );
}
